package com.bbs.feign.controller;

import com.bbs.feign.service.FeignService;
import com.bbs.resp.Result;
import com.bbs.resp.ResultMsg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/article")
public class FeignController {

    @Autowired
    private FeignService feignService;

    @RequestMapping("/details/{id}")
    public ResultMsg details(@PathVariable String id){

        return feignService.article(id);
    }

    @RequestMapping("/search")
    public Result findByLike(@RequestParam String q){

        return feignService.findByLike(q);
    }
}
